package demo;

public class Test {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(1);
        myArrayList.add(2);
        myArrayList.add(3);
        myArrayList.display();

        myArrayList.remove(3);
        myArrayList.display();

        //判断异常
        try {
            myArrayList.add(1,99);
        }catch (IndexOutOfException e){
            e.printStackTrace();
        }
        //打印
        myArrayList.display();
        System.out.println("==============");
        try {
            System.out.println(myArrayList.get(1));
        }catch (IndexOutOfException e){
            e.printStackTrace();
        }



    }
}
